#ifndef SCORESPRITE_H
#define SCORESPRITE_H

#include<QGraphicsItem>
#include<QObject>
#include"globalgamemsger.h"
class ScoreSprite : public QObject,public QGraphicsItem
{
    Q_OBJECT
    static QImage ScoreFonts[10];
    int score;
private slots:
    void scoreAdd();
    void onGameBegin();
    void onGameOver();
    void onGameRestart();
public:
    ScoreSprite(QGraphicsScene*scene=0);
    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr);
    QRectF boundingRect() const;
    void advance(int phase);
    QPainterPath shape() const;
    const int&Score=score;
};

#endif // SCORESPRITE_H
